<?php
// Pull in the NuSOAP code
require_once('../../library/nusoap/lib/nusoap.php');
// Create the server instance
$server = new soap_server;
// Register the method to expose
// Note: with NuSOAP 0.6.3, only method name is used w/o WSDL
$server->register(
    'hello',                            // method name
    array('name' => 'xsd:string'),      // input parameters
    array('return' => 'xsd:string'),    // output parameters
    'uri:helloworld',                   // namespace
    'uri:helloworld/hello',             // SOAPAction
    'rpc',                              // style
    'encoded'                           // use
);
// Define the method as a PHP function
function hello($name) {

$your_html = file_get_contents("http://localhost:90/iHelp/servers/listShoppingListItems");
/*echo $your_html;
$doc = new DOMDocument();
$doc->loadHTML($your_html);*/

  // return $doc->saveHTML();
  return $your_html;
}
//echo hello("");
function get_url_contents($url){
        $crl = curl_init();
        $timeout = 5;
        curl_setopt ($crl, CURLOPT_URL,$url);
        curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
        $ret = curl_exec($crl);
        curl_close($crl);
        return $ret;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>